import {User} from '../models/user';
import {Injectable} from 'angular2/core';
import {TaskInfo} from '../models/taskInfo';
import {Http, Headers} from 'angular2/http';

@Injectable()
export class AddTaskInfoService {
  constructor (private http:Http) {}

  sendTask(taskInfo:TaskInfo) {
    let url = "http://localhost:5000/api/task/add";
    let header = new Headers({'Content-Type' : 'application/json', 'Authorization':'Bearer '+localStorage.getItem("token")});
    

    return this.http.post(url, JSON.stringify(taskInfo), {headers: header});
  }
}
